package com.wc.AlgoOJ._暴力.A201;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2023/11/27 12:19
 * 发工资咯
 * http://43.138.190.70:8888/p/A201
 * @description
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] moneyNums = new int[]{100, 50, 10, 5, 2, 1};
        int money;
        while (n != 0) {
            int ans = 0;
            for (int i = 0; i < n; i++) {
                money = sc.nextInt();
                for (int moneyNum : moneyNums) {
                    int num = money / moneyNum;
                    ans += num;
                    money -= num * moneyNum;
                }
            }
            System.out.println(ans);
            n = sc.nextInt();
        }
    }
}
